Conventionally, in systems transmitting a data packet from a transmit buffer at a transmitting end to a receive buffer at a receiving end, the receiving end informs the transmitting end of the read state of data packets at the receive buffer, so as not to discard data packets due to overflow at the receive buffer. In this way, the transmitting end controls transmission of data packets in general.
For example, Japanese Laid-open Patent Publication No. 09-135270 (pages 2 to 4, FIGS. 1 to 3) discloses a technology involved in determining, based on the maximum length size (maximum size) of a data packet, the fixed number of queues (number of packets) in advance that can be stored in the receive buffer, and controlling transmission of data packets using the fixed number of queues determined. Referring to FIG. 22, the following describes this conventional technique in detail. FIG. 22 is a drawing for explaining an overview and features of a data packet transmission control system according to the conventional technique. As depicted in FIG. 22, an example is explained in which the size of the receive buffer at a receiving end is 16 bytes, the maximum length size of a data packet to be transmitted from the transmitting end is 4 bytes, and the fixed number of queues (number of packets) that can be stored in the receive buffer is determined as four in advance.
As depicted in FIG. 22, the transmitting end includes a credit control counter. Every time a data packet is read out from the transmit buffer and transmitted to the receiving end, the value in the credit control counter is incremented by one regardless of the size (data size) of a data packet to be transmitted (see (1) in FIG. 22). On the other hand, when receiving the data packet from the transmitting end, the receiving end writes the received data packet to the leading portion of the receive buffer (see (2) in FIG. 22). Every time reading out a data packet from the receive buffer, the receiving end transmits one credit back to the transmitting end, regardless of the size of the read data packet (see (3) in FIG. 22). Every time receiving such credit from the receiving end, the transmitting end subtracts the value of the credit from the value in the credit control counter (see (4) in FIG. 22).
In this way, the transmitting end increments and decrements the value in the credit control counter. As described, in this credit control counter, four is set and fixed in advance as the number of queues (the number of packets) that can be stored in the receive buffer. Therefore, at timing for reading out a data packet from the transmit buffer and transmitting the data packet to the receiving end, the transmitting end determines whether the current value in the credit control counter has reached the fixed value (four). If the current value in the credit control counter has not reached the fixed value (four), the transmitting end reads out a data packet from the transmit buffer, and transmits the data packet to the receiving end. On the other hand, if the current value in the credit control counter has reached the fixed value (four), the transmitting end determines that the receive buffer may be filled with data packets, so as to stop transmitting the data packet (see (5) in FIG. 22). Through such a series of processes, discarding data packets due to the overflow at the receive buffer is prevented in Japanese Laid-open Patent Publication No. 09-135270.
Other than the above conventional technique, a known technology uses a buffer as a ring buffer, by controlling credits so as to issue an additional credit depending on a free space in a receive buffer (see, for example, Japanese Laid-open Patent Publication No. 2001-94613 (pages 3 to 5, FIG. 1)). Further, a known technology enables easy management of transmitted data by using a management table for the use state of a transmit buffer in buffer control (see, for example, Japanese Laid-open Patent Publication No. 11-110315 (pages 6 to 10, FIGS. 1 to 2)).
The above conventional techniques, however, tend to create an unused area in the receive buffer as described below, posing a problem of not efficiently using resources of the receive buffer.
Specifically, in the above conventional techniques, the fixed number of queues that can be stored in the receive buffer is determined in advance based on the maximum length size of a data packet (four in the above example). Thus, even when the receive buffer stores therein data packets of small sizes not reaching the maximum length size of a data packet, for example, even when the receive buffer stores therein four packets of sizes: “4 bytes, 2 bytes, 2 bytes, and 2 bytes” as illustrated in FIG. 22, the value in the credit control counter at the transmitting end reaches the fixed value (four). As a result, the transmission of a data packet is stopped. In this case, a large unused area is created in the receive buffer (an unused area of 6 bytes is created in the above example), causing a problem of not efficiently using resources of the receive buffer.
The above problems are not limited to data packet transmission between communication apparatuses via a network, and also occur similarly in any systems that transmit a data packet from a transmit buffer at a transmitting end to a receive buffer at a receiving end, for example, in data packet transmission between circuits inside a computer system.